<!-- 个人中心 -->
<template>
    <view class="container">
        <view class="title">
           {{detailData.title}}
        </view>
        <view class="zhong">
            <view class="wz">文章来源：同学会沙龙活动
            </view>
            <view class="time">{{detailData.createtime | dateFormat}}
            </view>
        </view>
      <!-- <view class="img">
           <image style="width: 690rpx;height: 300rpx;" :src="detailData.img_main"></image>
        </view> -->
       <view class="content" v-html="detailData.info">
        </view>
		<!-- <view class="content" v-html="detailData"></view> -->
    </view>
</template>

<script>
    export default {
        data() {
            return {
				detailData:{}
            };

        },
		filters:{
			dateFormat(time) {
							let date = new Date(time*1000);
							let year = date.getFullYear();
							// 在日期格式中，月份是从0开始的，因此要加0，使用三元表达式在小于10的前面加0，以达到格式统一  如 09:11:05
							let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
							let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
							let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
							let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
							let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
							// 拼接
							return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
							//return year + "年" + month + "月" + day+"日";
			},
		},
        onLoad(option) {
			  console.log(option);
              let str = decodeURIComponent(option.data)
              	this.detailData = JSON.parse(str)
            // this.detailData=decodeURIComponent(option.data)
            console.log(str,this.detailData);
        },
        onShow() {

        },
        onReachBottom() {

        },
        computed: {

        },
        onPullDownRefresh() {},
        methods: {
            getData(id) {
                let that = this
                uni.request({
                    url: 'https://huboshizb.bigchun.com/api/info/detail', //仅为示例，并非真实接口地址。
                    method: 'POST',
                    data: {
                        article_id: Number(id),
                    },
                    success: (res) => {
                        
						that.detailData=res.data.data
						console.log('详情res', res,that.detailData)
                    }
                });
            },
        }
    }
</script>

<style lang="scss" scoped>
    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    .container{
        padding: 30rpx;
    }
    .title{
        font-size: 32rpx;
        font-family: Source Han Sans CN-Bold, Source Han Sans CN;
        font-weight: bold;
        color: #333333;
    }
    .zhong{
        display: flex;
        font-size: 28rpx;
        font-family: Source Han Sans CN-Regular, Source Han Sans CN;
        font-weight: 400;
        color: #CCCCCC;
        margin-top: 26rpx;
        justify-content: space-between;
    }
      
  .content{
      font-size: 28rpx;
      font-family: Source Han Sans CN-Regular, Source Han Sans CN;
      font-weight: 400;
      color: #333333;
       margin-top: 30rpx;
  }
  .img{
      margin-top: 30rpx;
  }
</style>
